#match6=re.search(r'(?P<ip>\d+.\d+.\d+.\d+) +(?P<mac>\w+-\w+-\w+) +.*(?P<port>V\S+)',line)
# match5=re.search(r' +(?P<vlan>\d+)$',line1)

import re

result=[]

regex1=r'(?P<ip>\d+.\d+.\d+.\d+) +(?P<mac>\w+-\w+-\w+) +.*(?P<port>\S+)$'
regex2=r' +(?P<vlan>\d+)$'

# with open(r'c:\tools\disp_arp.txt') as data:
with open(r'c:\tools\disp_arp.txt') as data:
	for line in data:
		print(line)
		match=re.search(regex2,line)
		if match:
			result[-1].update(match.groupdict())
			continue

		match=re.search(regex1,line)
		if match:
			result.append(match.groupdict())

for each_arp_record in result:
	if 'vlan' not in each_arp_record.keys():
		each_arp_record.update(({'vlan':'-'}))

		print(f'{len(result)} records on arp table:')

for i ,each_arp_record in enumerate(result,1):
	print(f'\ndetails of arp table {i}:')
	for key in each_arp_record:
		print(f'{key:10}:{each_arp_record[key]:10}')